//
//  EpointThreadTask.m
//  iphone.mobileoa
//  多线程处理任务类，每个任务可视为一段业务处理，该业务的处理会耗费一段时间
//  Created by 李亚春 on 13-5-23.
//  Copyright (c) 2013年 Epoint. All rights reserved.
//

#import "EpointThreadTask.h"
#import "StringUtil.h"
#import "EpointViewControllerBase.h"

@implementation EpointThreadTask

-(id)initWithContext:(EpointViewControllerBase *)_context andParams:(NSMutableDictionary *)_passparams;
{
    self = [super init];
    if (self) {
        threadGuid = [[StringUtil gen_uuid] retain];
        self.params = _passparams;
        context = _context;
    }
    return self;
}



-(NSString *)startTask
{
    [NSThread detachNewThreadSelector:@selector(execute) toTarget:self withObject:nil];
    return threadGuid;
}

-(void)execute
{
}

-(void)sendDataRefreshUI:(NSObject *)data
{
    dispatch_sync(dispatch_get_main_queue(), ^{
        [context refreshUIWithThreadGuid:threadGuid andData:data];
    });
}

@end
